import request from "@/utils/request";
import type { CategoryList } from "./model/categoryModel";

enum Api {
  getCategoryListUrl1 = "/admin/product/getCategory1",
  getCategoryListUrl2 = "/admin/product/getCategory2",
  getCategoryListUrl3 = "/admin/product/getCategory3",
}

export const getCategory1ListApi = () => {
  return request.get<any, CategoryList>(Api.getCategoryListUrl1);
};

export const getCategory2ListApi = (category1Id: number) => {
  return request.get<any, CategoryList>(
    Api.getCategoryListUrl2 + `/${category1Id}`
  );
};

export const getCategory3ListApi = (category2Id: number) => {
  return request.get<any, CategoryList>(
    Api.getCategoryListUrl3 + `/${category2Id}`
  );
};
